import createAxios from '/@/utils/axios'

const controllerUrl = '/admin/xmwms.OutboundOrder/'

export const actionUrl = new Map([['shipment', controllerUrl + 'shipment']])

export function auditPost(id: number) {
    return createAxios(
        {
            url: controllerUrl + 'audit',
            method: 'post',
            params: {
                id: id,
            },
        },
        {
            loading: true,
        }
    ) as ApiPromise
}

export function outboundOrderShipment(data: anyObj, outboundOrderId: number) {
    return createAxios(
        {
            url: controllerUrl + 'shipment?outbound_order_id=' + outboundOrderId,
            method: 'post',
            data: data,
        },
        {
            loading: true,
        }
    ) as ApiPromise
}

export function getShipmentData(outboundOrderId: string) {
    return createAxios(
        {
            url: controllerUrl + 'shipment?outbound_order_id=' + outboundOrderId,
            method: 'get',
        },
        {
            loading: true,
        }
    )
}
